import React, {PureComponent} from "react";
import {View, Text, StyleSheet, TouchableOpacity, Image, PixelRatio, Dimensions} from "react-native";
import {color} from "../../widget/color";
const {width} = Dimensions.get('window');
type Props = {
    info: Object,
    onPress: Function,
}

class AlteringCell extends PureComponent<Props> {

    render() {
        let {info} = this.props
        return (
            <TouchableOpacity
                onPress={() => this.props.onPress(info)}>
                <View style={styles.bg}>
                    <View style={{flexDirection:'row',justifyContent:'center',alignItems:'center',marginBottom:10}}>
                        <Text style={styles.content}>{info.course_title}</Text>
                        <View style={{flex:1}}/>
                        <Text style={{color:'#666666',fontSize:13}}>批改中</Text>
                    </View>
                    <View style={{flexDirection:'row', alignItems:'center',marginBottom:10}}>
                        <Text style={styles.content}>开课时间：</Text>
                        <Text style={{color:'#999999',fontSize:13,marginLeft:6}}>{info.start_at.substr(0, 16)}</Text>
                    </View>
                    <View style={{flexDirection:'row', alignItems:'center'}}>
                        <Text style={styles.content}>授课老师：</Text>
                        <Text style={{color:'#999999',fontSize:13,marginLeft:6}}>{info.teacher}</Text>
                    </View>
                </View>
            </TouchableOpacity>
        )
    }
}


const styles = StyleSheet.create({

    container: {
        flex: 1,
    },
    around: {
        flexDirection: 'row',
        // justifyContent: 'space-between',
        paddingRight: 12,
        paddingBottom: 12,
        paddingTop: 12,
        alignItems: 'center',

    },
    title_left: {
        marginLeft: 12,
        color: 'rgba(0, 0, 0, 0.5)',
        fontSize: 12,
    },
    content: {
        color: '#333333',
        fontSize: 13,
        maxWidth:250,
    },
    content2: {
        color: 'black',
        fontSize: 13,
        marginLeft: 8
    },
    content_right: {
        color: 'rgba(0, 0, 0, 0.5)',
        fontSize: 13,
    },
    line_data: {
        flexDirection: 'row',
        alignItems: 'center',
    },
    lines: {
        height: 0.5,
        width: width - 24,
        backgroundColor: 'rgba(0, 0, 0, 0.1)',
        marginBottom: 12,
        marginTop: 12,
    },
    submit_btn: {
        marginLeft: 15,
        borderRadius: 13,
        backgroundColor: '#DB3843',
        height: 25,
        width: 67,
        justifyContent: 'center',
        alignItems: 'center'
    },
    un_submit_btn: {
        marginLeft: 15,
        borderRadius: 13,
        backgroundColor: '#CECECE',
        height: 25,
        width: 67,
        justifyContent: 'center',
        alignItems: 'center'
    },
    around_bottom: {
        flexDirection: 'row',
        justifyContent: 'space-between',
        paddingRight: 12,
        paddingBottom: 12,
        alignItems: 'center'

    },
    bg: {
        backgroundColor: 'white',
        borderRadius: 5,
        flex: 1,
        shadowColor: '#B5B5B6',
        shadowOffset: {h: 2, w: 2},
        shadowRadius: 1,
        shadowOpacity: 0.4,
        marginTop: 6,
        marginLeft: 12,
        marginRight: 12,
        marginBottom: 6,
        paddingBottom:15,
        paddingTop:15,
        paddingRight:15,
        paddingLeft:15,
    }

})

export default AlteringCell
